package com.ocom.srvpaccess.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ocom.common.entity.human.EntityMsgYkmConfig;
import com.ocom.common.enums.DataSourceEnum;
import com.ocom.common.enums.MasterSlaveEnum;

import com.ocom.mysql.aspect.DataSourceAspect;
import com.ocom.srvpaccess.dao.IDaoMsgYkmConfig;
import com.ocom.srvpaccess.service.MsgYkmConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MsgYkmConfigServiceImpl extends ServiceImpl<IDaoMsgYkmConfig, EntityMsgYkmConfig> implements MsgYkmConfigService {

    @Autowired
    private IDaoMsgYkmConfig daoMsgYkmConfig;

    @DataSourceAspect(type= DataSourceEnum.PART_DB,companyId = "comId",isMaster = MasterSlaveEnum.SLAVE)
    @Override
    public List<EntityMsgYkmConfig> GetMsgYkmConfigList(Long comId,List<String> trigers) {
        QueryWrapper<EntityMsgYkmConfig> query = Wrappers.query();
        query.eq("com_id",comId);
        query.in("trig_ger",trigers);
        return daoMsgYkmConfig.selectList(query);
    }


}
